A network device (for example, a gateway) bears a large quantity of end-to-end service flows. Based on a perspective of a service, a service flow is a consecutive bit in a sequence. However, based on a perspective of packet transmission, a service flow may be encapsulated into a packet (for example, an Internet Protocol (IP) packet) sequence, and each packet is independently transmitted in a network.
In a process of processing these packets, a data plane of the network device usually needs to perform classification processing on these packets according to service flows to which the packets belong, for example, during processing, packets of a same service flow need to be processed in order.
A single-instance classifier is deployed in a conventional network device, where the single-instance classifier distributes packets to multiple flow queues according to a receiving order, network service processing units concurrently process the packets in a unit of flow queue, and packets in a same flow queue are processed in serial order on a network service processing unit. However, it is difficult for the single-instance classifier in the conventional network device to implement a packet distribution capability of supporting high performance and a high rate.